package com.example

import org.apache.spark.{SparkConf, SparkContext}

object work2 {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local[*]").setAppName("work2")
    val sc = new SparkContext(conf)
    sc.setLogLevel("ERROR")
    val rdd = sc.textFile("C:\\Users\\Administrator\\Desktop\\teacher.log")
    rdd.map(_.split("/").last)
       .map((_,1))
       .reduceByKey(_+_)
      .foreach(println(_))
  }
}
